require 'test/unit'
require 'Modele/Acces'
require 'Modele/Parking'
require 'Modele/Vehicule'
require 'Modele/Dbconect'

class  TeleporteurTest < Test::Unit::TestCase
  
  def test_recuperer_vehicule_ok
    Dbconect.creationbd("test")
    parking = Parking.new("test",3)
    vehi = Vehicule.new("999-fgh-30",15,19)
    parking.acces[0].affecter_place(vehi,nil)
    ticket = parking.get_place_by_vehicule("999-fgh-30").ticket
    assert(parking.acces[0].teleporteurs[0].recuperer_vehicule(ticket),"test_recuperer_vehicule_ok fail")
  end
  
  def test_recuperer_vehicule_pas_ok
     Dbconect.creationbd("test")
     parking = Parking.new("test",3)
     vehi = Vehicule.new("999-fgh-30",15,19)
     parking.acces[0].affecter_place(vehi,nil)
     assert(!(parking.acces[0].teleporteurs[0].recuperer_vehicule("999-fgh-20")),"test_recuperer_vehicule_pas_ok fail")
  end

  
end